package com.lantosec.hmrp.modules.category.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.category.vo.AssetsInfoVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 资产信息表 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-03-31
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class AssetsInfo extends BaseEntity<AssetsInfoVO> {

    private static final long serialVersionUID = 1L;
    public AssetsInfo(AssetsInfoVO vo){
        this.assetsId = vo.getAssetsId();
        this.assetsCode = vo.getAssetsCode();
        this.dirId = vo.getDirId();
        this.assetsName = vo.getAssetsName();
        this.categoryId = vo.getCategoryId();
        this.lableType = vo.getLableType();
        this.assetsState = vo.getAssetsState();
        this.brand = vo.getBrand();
        this.specification = vo.getSpecification();
        this.unit = vo.getUnit();
        this.buyDate = vo.getBuyDate();
        this.serviceLife = vo.getServiceLife();
        this.expireDate = vo.getExpireDate();
        this.price = vo.getPrice();
        this.nowPrice = vo.getNowPrice();
        this.supplierCode = vo.getSupplierCode();
        this.supplier = vo.getSupplier();
        this.factoryCode = vo.getFactoryCode();
        this.factory = vo.getFactory();
        this.useDeptId = vo.getUseDeptId();
        this.useDept = vo.getUseDept();
        this.useUserId = vo.getUseUserId();
        this.useUser = vo.getUseUser();
        this.areaId = vo.getAreaId();
        this.areaName = vo.getAreaName();
        this.belongDeptId = vo.getBelongDeptId();
        this.belognDept = vo.getBelognDept();
        this.manageUserId = vo.getManageUserId();
        this.manageUser = vo.getManageUser();
        this.storageLocation = vo.getStorageLocation();
        this.remark = vo.getRemark();
        this.photoList = vo.getPhotoList();
        this.summaryFlag = vo.getSummaryFlag();
        this.summaryNumber = vo.getSummaryNumber();
        this.createTime = vo.getCreateTime();
        this.createUserId = vo.getCreateUserId();
        this.createUser = vo.getCreateUser();
        this.editorTime = vo.getEditorTime();
        this.editorUserId = vo.getEditorUserId();
        this.editorUser = vo.getEditorUser();
        this.printTime = vo.getPrintTime();
        this.printUserId = vo.getPrintUserId();
        this.printUser = vo.getPrintUser();
        this.pictureUrl = vo.getPictureUrl();
        this.reviewState = vo.getReviewState();
        this.directoryFlag = vo.getDirectoryFlag();
        this.supplierFlag = vo.getSupplierFlag();
        this.productCode = vo.getProductCode();
        this.serviceEndDate = vo.getServiceEndDate();
        this.categoryName = vo.getCategoryName();
        this.checkState = vo.getCheckState();
        this.checkUser = vo.getCheckUser();
        this.checkTime = vo.getCheckTime();
        this.isPrint = vo.getIsPrint();
    }

    @Override
    public AssetsInfoVO convertToVO(){
        return new AssetsInfoVO(this);
    }


    /**
     * 资产ID
     */
    @TableId(value = "assets_id", type = IdType.ASSIGN_UUID)
    private String assetsId;

    /**
     * 资产编码(打印用,格式：LT[hsptcode]_xxxxxx),自动生成
     */
    private String assetsCode;

    /**
     * 目录ID，手工录入时自动生成
     */
    private String dirId;

    /**
     * 资产名称
     */
    private String assetsName;

    /**
     * 资产类别
     */
    private String categoryId;

    /**
     * 标签材质(0无标签 1普通RFID 2抗金属RFID，仅为0时可勾选summary_flag)
     */
    private Integer lableType;

    /**
     * 资产状态(正常,遗失,标签破损,维修,报废,违规异动)
     */
    private String assetsState;

    /**
     * 品牌
     */
    private String brand;

    /**
     * 规格型号
     */
    private String specification;

    /**
     * 计量单位
     */
    private String unit;

    /**
     * 购买日期(yyyy-MM-dd)
     */
    private String buyDate;

    /**
     * 折旧年限(月)
     */
    private Integer serviceLife;

    /**
     * 到期日期(yyyy-MM-dd)
     */
    private String expireDate;

    /**
     * 资产原值(购买价格)
     */
    private BigDecimal price;

    /**
     * 资产净值
     */
    private BigDecimal nowPrice;

    /**
     * 供应商编码
     */
    private String supplierCode;

    /**
     * 供应商名称
     */
    private String supplier;

    /**
     * 生产厂家编码
     */
    private String factoryCode;

    /**
     * 生产厂家名称
     */
    private String factory;

    /**
     * 使用部门ID
     */
    private String useDeptId;

    /**
     * 使用部门
     */
    private String useDept;

    /**
     * 使用人ID
     */
    private String useUserId;

    /**
     * 使用人
     */
    private String useUser;

    /**
     * 所在区域ID
     */
    private String areaId;

    /**
     * 所在区域名称
     */
    private String areaName;

    /**
     * 归属部门ID
     */
    private String belongDeptId;

    /**
     * 归属部门
     */
    private String belognDept;

    /**
     * 管理员ID
     */
    private String manageUserId;

    /**
     * 管理员
     */
    private String manageUser;

    /**
     * 存放地点
     */
    private String storageLocation;

    /**
     * 备注说明
     */
    private String remark;

    /**
     * 照片列表，sys_uploads表ID集合
     */
    private String photoList;

    /**
     * 是否汇总数量(0 否，1 是，默认0)
     */
    private Integer summaryFlag;

    /**
     * 汇总数量值(默认1)
     */
    private Integer summaryNumber;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 创建人ID
     */
    private String createUserId;

    /**
     * 创建人
     */
    private String createUser;

    /**
     * 最后编辑时间
     */
    private Date editorTime;

    /**
     * 最后编辑人ID
     */
    private String editorUserId;

    /**
     * 最后编辑人
     */
    private String editorUser;

    /**
     * 最后打印时间
     */
    private Date printTime;

    /**
     * 最后打印人ID
     */
    private String printUserId;

    /**
     * 最后打印人
     */
    private String printUser;
    /**
     * 审核状态 0待审核 1已审核
     */
    private Integer reviewState;

    /**
     * 产品码
     */
    private String productCode;

    /**
     * 产维保到期日期(yyyy-MM-dd)
     */
    private String serviceEndDate;
    
    /**
     * 图片路径
     */
    @TableField(exist = false)
    private List pictureUrl;

    /**
     * 物资是否存在资产目录表，1已存在
     */
    @TableField(exist = false)
    private Integer directoryFlag;

    /**
     * 供应商是否存在供应商及厂家目录表，1已存在
     */
    @TableField(exist = false)
    private Integer supplierFlag;

    /**
     * 资产类别名称
     */
    @TableField(exist = false)
    private String categoryName;

    /**
     * 盘点状态
     */
    @TableField(exist = false)
    private Integer checkState;
    /**
     * 盘点时间
     */
    @TableField(exist = false)
    private String checkTime;

    /**
     * 盘点人
     */
    @TableField(exist = false)
    private String checkUser;

    @TableField(exist = false)
    private Integer isPrint;


    public enum ColName {
        assets_id, assets_code, review_state,dir_id, assets_name, category_id, lable_type, assets_state, brand, specification, unit, buy_date, service_life, expire_date, price, now_price, supplier_code, supplier, factory_code, factory, use_dept_id, use_dept, use_user_id, use_user, area_id, area_name, belong_dept_id, belogn_dept, manage_user_id, manage_user, storage_location, remark, photo_list, summary_flag, summary_number, create_time, create_user_id, create_user, editor_time, editor_user_id, editor_user, print_time, print_user_id, print_user,
    }
}
